/**
 *品质365
 *date 2012/11/06
 *底层通用函数
 */
 (function($){   
 	 //当前位置居中 
     $.fn.center = function(){
         var top = ($(window).height() - this.height())/2;
         var left = ($(window).width() - this.width())/2;
         var scrollTop = $(document).scrollTop();
         var scrollLeft = $(document).scrollLeft();
         if (top<0) {
          var top = 30;
         }
         return this.css( { position : 'absolute', 'top' : top+scrollTop, left : left + scrollLeft } );
     }
 })(jQuery)

//tab切换
function tabChange(dom,obj,tabOn,tabShow){
	obj.addClass(tabOn).siblings().removeClass(tabOn);
  obj.attr("checked","checked").siblings().removeAttr("checked");
	var index =  dom.index(obj);
	$(tabShow).eq(index).show().siblings().hide();
}
 //插入蒙层
 function appendThick(){
 	var docu = $('body');
 	var hei= docu.height();
 	docu.append("<div class='thickdiv'></div>");
 	$('.thickdiv').css("height",hei);
 }
//蒙层remove
function removeThick(){
 	$('.thickdiv').remove();
 }
 //提示层显示
 function tripLayer(){
 	$('.bodyTrip').show().center();
 	var hei = $('.layer-box-trip').height();
    $('.layer-skin').height(hei +(20));
 }
  //提示层隐藏
   function hideTripLayer(){
 	$('.bodyTrip').hide();
 }
  /**
 * 隐藏窗体
 * @param obj
 */
function hideDialog(obj){
    $(obj).hide();
}